<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.thymeleaf.org ">
<head>
    <meta charset="UTF-8">
    <title>SpringBoot进阶首页</title>
    <base href="http://localhost:8083/async/">
    <script src="js/jquery-3.1.0.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    <!--
    1、./是当前目录

    2、../是父级目录

    3、/是根目录
    -->
    <p>登录验证</p>
    <span th:text="${msg}" style="color:red"></span>
    <form action="user/login" method="post">
        <input type="text" th:value="${session.curUser==null?'':session.curUser.username}" name="username">
        <input type="text" th:value="${session.curUser==null?'':session.curUser.password}" name="password">
        <input type="submit" value="login">
    </form>
    <br>
    <hr>
    
    <p>Swagger Api Document文档测试</p>
    <a href="http://localhost:8082/async/swagger-ui.html">Swagger Api Document</a>
    <br>
    <hr>
    
    <p>GlobalResponseHandler类测试</p>
    <a href="user/getUserById">无ID查询用户</a>
    <a href="user/getUserById?uid=1">查询ID=1的用户</a>
    <p>全局异常处理测试</p>
    <a href="exception/arithmeticError?uid=1">发送算数异常</a>
    <a href="exception/fileNotFindError?uid=1">发送IO异常</a>
    <a href="exception/123">发送404异常</a>
    <br>
    <hr>
    
    <p>Servlet测试</p>
    <a href="myServlet01?username=你好Servlet01">发送servlet01请求</a>
    <a href="myServlet02?username=你好Servlet02">发送servlet02请求</a>
    <a href="myServlet03?username=你好Servlet03">发送servlet03请求</a>
    <br>
    <hr>

    <p>Aop测试</p>
    <a href="aop/testAop?id=1">aop测试Service</a>
    <a href="aop/testAop2">aop测试Controller</a>
    <br>
    <hr>
    
    <p>文件上传下载测试</p>
    <span>单文件上传</span>
    <form action="file/upload" method="post" enctype="multipart/form-data">
        USERID：<input type="number" th:value="${session.curUser==null?'':session.curUser.id}" name="id">
        文件：<input type="file" name="oneFile">
        <input type="submit" value="upload">
    </form>
    <img th:src="${path}">
    <br>
    <span>多文件上传</span>
    <form action="file/uploads" method="post" enctype="multipart/form-data">
        USERID：<input type="number" th:value="${session.curUser==null?'':session.curUser.id}" name="id">
        文件：<input type="file" name="files" multiple>
        <input type="submit" value="upload">
    </form>
    
    <span>文件下载</span>
    <a href="file/downLoad?id=13">downLoad photo</a>
    <img src="upload/file/1652202406082报名照片.jpg" alt="">
    <br>
    <hr>

    <p>Spring事务测试</p>
    <form action="user/addUser" method="post">
        <input type="text" th:value="${user==null?'':user.username}" name="username">
        <input type="text" th:value="${user==null?'':user.password}" name="password">
        <input type="submit" value="success add">
    </form>
    <form action="user/addUserException" method="post">
        <input type="text" th:value="${user==null?'':user.username}" name="username">
        <input type="text" th:value="${user==null?'':user.password}" name="password">
        <input type="submit" value="exception add">
    </form>

    <p>嵌套事务</p>
    <form action="user/addUserAndImg" method="post" enctype="multipart/form-data">
        <input type="text" name="username">
        <input type="text" name="password">
        <input type="file" name="file">
        <input type="submit" value="trans submit">
    </form>
</body>
</html>